﻿using System.Xml.Serialization;

namespace FuiouPay.Models.Response {
    [XmlRoot("xml")]
    public class HisTradeQueryResponseInfo : FuiouResponseInfo {
        /// <summary>
        /// 用户在商户的id
        /// </summary>
        [XmlElement("buyer_id")]
        public string BuyerId { get; set; }

        /// <summary>
        /// 查询状态，详见应答码表--查询应答码
        /// </summary>
        [XmlElement("trans_stat")]
        public string TransStat { get; set; }

        /// <summary>
        /// 订单金额，单位为分
        /// </summary>
        [XmlIgnore]
        public long? OrderAmt { get; set; }

        [XmlElement("order_amt")]
        public string strOrderAmt {
            get {
                return this.OrderAmt.ToString();
            }
            set {
                if (long.TryParse(value, out long num)) {
                    this.OrderAmt = num;
                } else {
                    this.OrderAmt = null;
                }
            }
        }

        /// <summary>
        /// 商户订单号, 商户系统内部的订单号(5到30个字符、只能包含字母数字,区分大小写)
        /// </summary>
        [XmlElement("mchnt_order_no")]
        public string MchntOrderNo { get; set; }

        /// <summary>
        /// 附加数据
        /// </summary>
        [XmlElement("addn_inf")]
        public string AddnInf { get; set; }

        /// <summary>
        /// 富友交易日期
        /// </summary>
        [XmlElement("reserved_fy_settle_dt")]
        public string ReservedFySettleDt { get; set; }

        /// <summary>
        /// 优惠金额(分)
        /// </summary>
        [XmlElement("reserved_coupon_fee")]
        public string ReservedCouponFee { get; set; }

        /// <summary>
        /// 买家在渠道登录账号
        /// </summary>
        [XmlElement("reserved_buyer_logon_id")]
        public string ReservedBuyerLogonId { get; set; }

        /// <summary>
        /// 支付宝交易资金渠道，详细渠道
        /// </summary>
        [XmlElement("reserved_fund_bill_list")]
        public string ReservedFundBillList { get; set; }

        /// <summary>
        /// 富友系统内部追踪号
        /// </summary>
        [XmlElement("reserved_fy_trace_no")]
        public string ReservedFyTraceNo { get; set; }

        /// <summary>
        /// 条码流水号，用户账单二维码对应的流水
        /// </summary>
        [XmlElement("reserved_channel_order_id")]
        public string ReservedChannelOrderId { get; set; }

        /// <summary>
        /// 富友终端号
        /// </summary>
        [XmlElement("reserved_fy_term_id")]
        public string ReservedFyTermId { get; set; }
    }
}
